package com.xiaohao.communication.neo4j_controller;

import com.xiaohao.communication.neo4j_service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MainController {

    @Autowired
    UserService userService;


    /*
     * 插入用户和话题的链接
     * */
    @ResponseBody
    @GetMapping("/insert")
    public String insertLink(@RequestParam("user_id") String user_id, @RequestParam("topic_id") String topic_id) {
        userService.insertLink(user_id, topic_id);
        return "success";
    }

    /*
     * 返回推荐的话题
     * */

//    @ResponseBody
//    @PostMapping("/get")
//    public String getTopic(int user_id){
//        int recommendTopic = userService.getRecommendTopic(user_id);
//        System.out.println(recommendTopic);
//        return "success";
//    }


}
